import xlrd
import subprocess
import os

file = './config.xls'




filePath = os.path.join(os.getcwd(), file)
#print(GetPath(os.getcwd(),".."))


#print("++++++++++++++++++++++0.12")
wb = xlrd.open_workbook(filename=filePath)#打开文件
sheet1 = wb.sheet_by_name("Text")
strV=sheet1.cell_value(1, 2)

print(strV)

import subprocess

filename = 'py'
with open(filename+".json",'w',encoding='utf-8') as f: # 如果filename不存在会自动创建， 'w'表示写数据，写之前会清空文件中的原有数据！
    f.write(strV)
result = subprocess.check_output(['lua', '-l', 'test', '-e', 'Read("py")'])
print(result)

#for v in wb.sheet_names():
#   print(v)
#print(wb.sheet_names())#获取所有表格名字
